﻿//-----------------------------------------------------------------------
// <copyright file="IDynamicSettingRepository.cs" company="FastNET Services">
//     Copyright (c) 2008-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings
using System.Collections.Generic;
using FastNET.CleanAct.Common.Repository.Interfaces.DataInterfaces.Client;
using FastNET.CleanAct.Common.Repository.Interfaces.Repositories.Base;
#endregion

namespace FastNET.CleanAct.Common.Repository.Interfaces.Repositories.Client
{
    /// <summary>
    /// Respository interface for managing IDynamicSettingData
    /// </summary>
    public interface IDynamicSettingRepository
        : IIdentityRepository<IDynamicSettingData>
    {
        /// <summary>
        /// Retrieves all settings associated with a profile
        /// </summary>
        /// <param name="profileID">Profile of the setting group to retrieve or null for the global settings</param>
        /// <returns>List of IDynamicSettingData found</returns>
        IList<IDynamicSettingData> RetrieveByProfileID(Identity? profileID);

        /// <summary>
        /// Retrieves all settings associated with a key name
        /// </summary>
        /// <param name="keyName">Key of the settings to retrieve</param>
        /// <returns>List of IDynamicSettingData found</returns>
        IList<IDynamicSettingData> RetrieveByKeyName(string keyName);

        /// <summary>
        /// Retrieves a single setting using the profile ID and the key name
        /// </summary>
        /// <param name="profileID">Profile of the setting group to retrieve or null for the global settings</param>
        /// <param name="keyName">Key of the setting to retrieve</param>
        /// <returns>IDynamicSettingData found or null if the setting does not exist</returns>
        IDynamicSettingData RetrieveByProfileAndKey(Identity? profileID, string keyName);
    }
}
